package com.qf.common.exception;

import com.qf.common.core.domain.ResponseCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Author: sin
 * @Date: 2024/10/10 18:58
 * @Description: 自定义异常
 **/
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class BaseException extends RuntimeException{

    /**
     * 异常码
     */
    private Integer code;

    /**
     * 异常信息
     */
    private String errMessage;

    public BaseException(ResponseCode r) {
        this.errMessage = r.getDesc();
        this.code = r.getCode();
    }
}
